<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>改变HTML属性</title>
</head>

<body>
    <img id="image" src="landscape.jpg" width="160" height="120">
    <script>
        document.getElementById("image").src = "landscape.jpg";
    </script>
    <p>原图片为 smiley.gif,脚本将图片修改为 landscape.jpg</p>
</body>

</html>